Socket
Socket
Sign inDemoInstall

monero-regex

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    monero-regex

Regular expression for matching Monero (XMR) addresses.


Version published
Weekly downloads
157
increased by29.75%
Maintainers
1
Install size
5.95 kB
Created
Weekly downloads
 

Readme

Source

monero-regex Build Status XO code style

Regular expression for matching Monero (XMR) addresses

Install

~ ❯❯❯ npm install monero-regex

Usage

const moneroRegex = require('monero-regex');

moneroRegex().test('nodejsrocks 47BnvD18P456f4KJUBKPS3Rqa97LrTaeqJ5NFYmjQM6nVoz6TBv4rJ24GZk883BNo22fAKbr8BSuTjhQC6K7DsSJFa8SHDs');
//=> true

moneroRegex({exact: true}).test('nodejsrocks 47BnvD18P456f4KJUBKPS3Rqa97LrTaeqJ5NFYmjQM6nVoz6TBv4rJ24GZk883BNo22fAKbr8BSuTjhQC6K7DsSJFa8SHDs foo');
//=> false

moneroRegex({exact: true}).test('47BnvD18P456f4KJUBKPS3Rqa97LrTaeqJ5NFYmjQM6nVoz6TBv4rJ24GZk883BNo22fAKbr8BSuTjhQC6K7DsSJFa8SHDs');
//=> true

'nodejsrocks 47BnvD18P456f4KJUBKPS3Rqa97LrTaeqJ5NFYmjQM6nVoz6TBv4rJ24GZk883BNo22fAKbr8BSuTjhQC6K7DsSJFa8SHDs unicorn 42oAxV3DVXXG3HhyCyi2xaPukKXbip9Sx1YuJtoCqjZRSze4tYCq7n3VUswDBFV59Zev8yfHSZro4TUwXumtRWnQ8xQipkC rainbow'.match(moneroRegex());
//=> ['47BnvD18P456f4KJUBKPS3Rqa97LrTaeqJ5NFYmjQM6nVoz6TBv4rJ24GZk883BNo22fAKbr8BSuTjhQC6K7DsSJFa8SHDs', '42oAxV3DVXXG3HhyCyi2xaPukKXbip9Sx1YuJtoCqjZRSze4tYCq7n3VUswDBFV59Zev8yfHSZro4TUwXumtRWnQ8xQipkC']

API

moneroRegex([options])

Returns a regex for matching Monero (XMR) addresses.

options.exact

Type: boolean
Default: false (Matches any XMR address in a string)

Only match an exact string. Useful with RegExp#test() to check if a string is an XMR address.

  • ethereum-regex - Regular expression for matching Ethereum (ETH) addresses.
  • litecoin-regex - Regular expression for matching Litecoin (LTC) addresses.
  • bitcoincash-regex - Regular expression for matching Bitcoin Cash (BCH) addresses.
  • dash-regex - Regular expression for matching Dash addresses.
  • ripple-regex - Regular expression for matching Ripple (XRP) addresses.
  • neo-regex - Regular expression for matching NEO addresses.
  • dogecoin-regex - Regular expression for matching Dogecoin (DOGE) addresses.

License

MIT © Nikolaos Kamarinakis

Keywords

FAQs

Last updated on 08 Aug 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc